<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>代理console.log</title>
	</head>
	<body>
		<script>
			//apply
			function log(){
				console.log.apply(console, arguments);
				//let args = Array.prototype.slice.call(arguments);
				//args.unshift("app");
				//console.log.apply(console, args);
			}
			log(1)
			log(1,2)

			//let altwrite = document.write.bind(document);
			//altwrite("hello,world");
			//altwrite.bind(document)("hello,world");
			
//			this.num = 9;
//			let mymodule = {
//				num : 81,
//				getNum: function(){
//					console.log(this.num);
//				}
//			}
//			mymodule.getNum();
//			let getNumber = mymodule.getNum;
//			getNumber();
//			
//			let boundGetNumber = getNumber.bind(mymodule);
//			boundGetNumber();
		</script>
	</body>
</html>
